/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package py.com.mblj.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author markos
 */
@Entity
@Table(name = "tipos")
@NamedQueries({@NamedQuery(name = "Tipos.findAll", query = "SELECT t FROM Tipos t"), @NamedQuery(name = "Tipos.findByTiTipo", query = "SELECT t FROM Tipos t WHERE t.tiTipo = :tiTipo"), @NamedQuery(name = "Tipos.findByTiDescripcion", query = "SELECT t FROM Tipos t WHERE t.tiDescripcion = :tiDescripcion")})
public class Tipos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ti_tipo")
    private Integer tiTipo;
    @Column(name = "ti_descripcion")
    private String tiDescripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "deTipo", fetch = FetchType.LAZY)
    private List<Denuncias> denunciasList;

    public Tipos() {
    }

    public Tipos(Integer tiTipo) {
        this.tiTipo = tiTipo;
    }

    public Integer getTiTipo() {
        return tiTipo;
    }

    public void setTiTipo(Integer tiTipo) {
        this.tiTipo = tiTipo;
    }

    public String getTiDescripcion() {
        return tiDescripcion;
    }

    public void setTiDescripcion(String tiDescripcion) {
        this.tiDescripcion = tiDescripcion;
    }

    public List<Denuncias> getDenunciasList() {
        return denunciasList;
    }

    public void setDenunciasList(List<Denuncias> denunciasList) {
        this.denunciasList = denunciasList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tiTipo != null ? tiTipo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tipos)) {
            return false;
        }
        Tipos other = (Tipos) object;
        if ((this.tiTipo == null && other.tiTipo != null) || (this.tiTipo != null && !this.tiTipo.equals(other.tiTipo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.mblj.domain.Tipos[tiTipo=" + tiTipo + "]";
    }

}
